<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="x"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<a href="${pageContext.request.contextPath}/toinsert">添加</a>
<form  action="${pageContext.request.contextPath}/deleteStock">
	<table border=1 align="center">
		<tr>
		<td>选择</td>
			<td>编号</td>
			<td>产品</td>
			<td>价格</td>
			<td>S</td>
			<td>M</td>
			<td>L</td>
			<td>总数</td>
			<td>图片</td>
			<td>状态</td>
			<td>上下架</td>
			<td>修改</td>
		</tr>
		<x:forEach items="${stock}" var="stock">
		<tr>
		<td ><input type="checkbox" name="stock_id" value="${stock.stock_id}"/></td>
			<td >${stock.stock_id}</td>
			<td >${stock.product}</td>
			<td >${stock.price}</td>
			<td >${stock.s}</td>
			<td >${stock.m}</td>
			<td >${stock.l}</td>
			<td >${stock.quantity}</td>
			<td ><img src="${pageContext.request.contextPath }/${stock.url}"/></td>
			<td >${stock.status}</td>
			<form action="${pageContext.request.contextPath}/updateStatus">
			<td>
				
					<input type="hidden" name = "id" value = "${stock.stock_id}">
					<input type="hidden" name = "status" value = "${stock.status}">
					<input type="submit" value="上下架"></td>
			</td>
			</form>
			<td><a href="${pageContext.request.contextPath}/toupdate">修改</a></td>
		</tr>
		</x:forEach>
		<input type="submit" value="删除">
	</table>
	</form>
	
</body>
</html>